//
//  UIViewController+Category.m
//  s.
//
//  Created by 谈虎啸 on 2022/8/31.
//  Copyright © 2022 J. All rights reserved.
//

#import "UIViewController+Category.h"
#import "MBProgressHUDTool.h"
static const void *HLeventTransmissionBlockKey = &HLeventTransmissionBlockKey;

@implementation UIViewController (Category)

- (void)setEventTransmissionBlock:(CHGEventTransmissionBlock)eventTransmissionBlock {
    objc_setAssociatedObject(self, HLeventTransmissionBlockKey, eventTransmissionBlock, OBJC_ASSOCIATION_COPY);
}

- (CHGEventTransmissionBlock)eventTransmissionBlock {
    return objc_getAssociatedObject(self, HLeventTransmissionBlockKey);
}


#pragma makr - 弹框提示
/// 提示信息(文字)
- (void)sb_promptWithTitle:(NSString *)title
{
    [MBProgressHUDTool showMessageMessage:title];
}
/// 提示信息(icon+文字)
- (void)sb_promptWithImageName:(NSString *)imageName withTitle:(NSString *)title
{
    [MBProgressHUDTool showSucceedMessageForView:nil message:title ImageName:imageName];
}

/// 提示信息(菊花)
- (void)sb_promptWithChrysanthemum
{
    [MBProgressHUDTool showChrysanthemumForView:nil];
}

/// 提示信息(菊花+文字)
- (void)sb_promptWithChrysanthemumWithTitle:(NSString *)title
{
    [MBProgressHUDTool showChrysanthemumForView:nil Message:title];
}

/// 提示信息(自定义)
- (void)sb_promptWithGifImageArray:(NSArray *)imageArray
{
    [MBProgressHUDTool showHUDWithImageArray:imageArray];
}

/// 隐藏提示弹框
- (void)sb_hideHUD
{
    [MBProgressHUDTool hideMBProgressHUDForView:nil];
}
@end
